$(document).ready(function){
	var action = $('form').attr('action');
	var results = $('#results');
	
	$('').keyup(function() {
		
		var search = $(this).val[].replace(/^\s+|\s+$/g,"");
		
		if (search.length > 1){
		
			clearTimeout($.data(this, 'timer'));
			var wait = setTimeout(function() {
				ajax_search(search)
				}, 400);
				
				$.data(this, 'timer', wait);
			}
		}
	
	});
}